import { ExpeditionOrder } from './../../models/expeditionOrder';
import { Devices } from './../../models/devices';
import { Order } from './../../models/order';
import { IMessageHandle, IMessageStruct } from './messageHandleManager';

export class OrderMessageHandle implements IMessageHandle {
    get MessageName() { return "order"; }
    get HandleName() { return "OrderMessageHandle"; }
    OnReceived(sender, args: IMessageStruct) {
        this.OnMessage && this.OnMessage(args.body);
    }

    OnMessage: (order: Order) => void;
}

export class DeviceMessageHandle implements IMessageHandle {
    get MessageName() { return "device"; }
    get HandleName() { return "DeviceMessageHandle"; }
    OnReceived(sender, args: IMessageStruct) {
        this.OnMessage && this.OnMessage(args.body);
    }

    OnMessage: (Device: Devices) => void;
}

export class ExpeditionOrderMessageHandle implements IMessageHandle {
    get MessageName() { return "expeditionOrder"; }
    get HandleName() { return "ExpeditionOrderessageHandle"; }
    OnReceived(sender, args: IMessageStruct) {
        this.OnMessage && this.OnMessage(args.body);
    }

    OnMessage: (order: ExpeditionOrder) => void;
}